<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/15
 * Time: 21:16
 */
namespace App\Admin\Extensions;

use Encore\Admin\Admin;

class Profile
{
    protected $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

    protected function script()
    {
        return <<<SCRIPT



SCRIPT;
    }

    public function render()
    {
        Admin::script($this->script());

        return '<a class="btn btn-xs btn-default grid-expand" data-inserted="0" data-key="'.$this->id.'" data-toggle="collapse" data-target="#grid-collapse-'.$this->id.'">
    <i class="fa fa-caret-right"></i> Profile
</a>';
    }

    public function __toString()
    {
        return $this->render();
    }
}